//
//  RCDHttpTool.h
//  RCloudMessage
//
//  Created by Liv on 15/4/15.
//  Copyright (c) 2015年 RongCloud. All rights reserved.
//  网络请求工具类

#import <Foundation/Foundation.h>
#import <RongIMLib/RCUserInfo.h>
#import <RongIMLib/RCGroup.h>
#import "HQMessage.h"
#import "MYAccountInfoObject.h"

#define RCDHTTPTOOL [RCDHttpTool shareInstance]

@interface RCDHttpTool : NSObject


@property (nonatomic,strong) NSMutableArray *allFriends;
@property (nonatomic,strong) NSMutableArray *allGroups;

+ (RCDHttpTool*)shareInstance;


//查看是否好友


//获取个人信息
- (void)getUserInfoByUid:(NSString*)uid
                   token:(NSString*)token
               searchUid:(NSString*)searchUid
              completion:(void (^)(RCUserInfo *user)) completion;
//获取pengyou信息
- (void)getFriendInfoByUid:(NSString*)uid
                     token:(NSString*)token
                 searchUid:(NSString*)searchUid
                completion:(void (^)(MYAccountInfoObject *user)) completion;


//获取好友列表
-(void) getFriendsWithUid:(NSString*)uid
                    token:(NSString*)token
                 keyWords:(NSString*)keyWords
                 pageSize:(NSInteger)pageSize
                  pageNum:(NSInteger)pageNum
                 complete:(void (^)(NSMutableArray* result))friendList;

// 搜素好友
- (void)searchFriendWithUserId:(NSString*)userId
                         token:(NSString*)token
                      nickName:(NSString*)nickName
                       pageNum:(NSInteger)pageNum
                      pageSize:(NSInteger)pageSize
                      complete:(void (^)(NSMutableArray* result))friendList;


//请求加好友
- (void)addFriendWithUserId:(NSString *)userId
                      token:(NSString*)token
                   friendId:(NSString*)friendId
                  addRemark:(NSString*)remark
                   complete:(void (^)(BOOL result))result;
//新朋友列表
- (void)getNewFriendListWithUid:(NSString*)uid
                          token:(NSString*)token
                       complete:(void (^)(NSMutableArray* result))friendList;


//处理请求加好友

//删除好友

//更新自己的用户名

/*
 +(void)getUserInfoByUid:(NSString *)uid
 token:(NSString *)token
 searchUid:(NSString *)searchUid
 success:(void (^)(id response))success
 failure:(void (^)(NSError* err))failure;
 */
//从server 获取用户的信息，更新本地数据库
- (void)updateUserInfoByUid:(NSString*)uid
                      token:(NSString*)token
                  searchUid:(NSString*)searchUid
                    success:(void (^)(RCUserInfo * user))success
                    failure:(void (^)(NSError* err))failure;
// 图片上传
- (void)uploadImageWith:(UIImage*)img
              imgBelong:(NSString*)imgBelong
                success:(void (^)(NSString* imageURLString))success
                failure:(void (^)(NSError* err))failure;

// 创建群组
- (void)createGroupWithUid:(NSString *)uid
                     token:(NSString *)token
              groupUsersId:(NSString *)groupUsersId
                  groupImg:(NSString *)groupImg
                 groupName:(NSString *)groupName
                   success:(void (^)(NSString* groupId))success
                   failure:(void (^)(NSError* err))failure;
// 根据群id获取群
- (void)getGroupInfoByUid:(NSString *)uid
                    token:(NSString *)token
                  groupId:(NSString*)groupId
        successCompletion:(void (^)(RCGroup *group)) completion;
// 删除好友
- (void)deleteFriendByUid:(NSString *)uid
                    token:(NSString *)token
                 friendId:(NSString *)friendId
                 complete:(void (^)(BOOL result))result;
// 查询群成员
- (void)getGroupMemberListByUid:(NSString *)uid
                          token:(NSString *)token
                        groupId:(NSString *)groupId
                       complete:(void (^)(NSMutableArray* result))memberList;
// 更新群接口
- (void)updateGroupByUid:(NSString*)uid
                   token:(NSString *)token
                 groupId:(NSString *)groupId
            WithGroupImg:(NSString *)groupImg
               groupName:(NSString *)groupName
                complete:(void (^)(BOOL result))result;
// 管理权转让
- (void)attornGroupMgrByUid:(NSString *)uid
                      token:(NSString *)token
                    groupId:(NSString *)groupId
              withCreateUid:(NSString *)createUid
                   complete:(void (^)(BOOL result))result;
// 群成员变动
- (void)updateGroupMemberByUid:(NSString *)uid
                         token:(NSString *)token
                       groupId:(NSString *)groupId
                  withOperType:(NSString *)operType
                   groupUserId:(NSString *)groupUserId
                      complete:(void (^)(BOOL result))result;
// 退出群
- (void)quitGroupByUid:(NSString *)uid
                 token:(NSString *)token
               groupId:(NSString *)groupId
              complete:(void (^)(BOOL result))result;
// 清空新朋友列表
- (void)cleanNewFriendsApplyListByUid:(NSString *)uid
                                token:(NSString *)token
                           userIdSets:(NSString *)userIdSets
                             complete:(void (^)(BOOL result))result;
// 查询我的群组
- (void)getMyGroupsByUid:(NSString *)uid
                   token:(NSString *)token
                complete:(void (^)(NSMutableArray* result))groupListArray;
// 查询是否注册
- (void)searchRegUsersListByUid:(NSString *)uid
                          token:(NSString *)token
                    phoneNumber:(NSString *)phoneNumber
                       complete:(void (^)(NSMutableArray* result))userList;
// 获取通知消息
- (void)getFirstNotificationByUid:(NSString *)uid
                            token:(NSString *)token
                successCompletion:(void (^)(HQMessage *model)) completion;
//4.8.2.	查询评论信息列表  T064
/*uid	登录用户id	必传
 token	登录用户token	必传
 msgId	消息id	选送
 */
- (void)getCommentMsgsListByUid:(NSString *)uid
                          token:(NSString *)token
                          msgId:(NSString *)msgId
                       complete:(void (^)(NSMutableArray* result))commentList;
// 4.8.3.	查询回复信息列表
- (void)getFcommentMsgsListByUid:(NSString *)uid
                           token:(NSString *)token
                           msgId:(NSString *)msgId
                        complete:(void (^)(NSMutableArray* result))fcommentList;
// 4.8.4.	查询点赞信息列表  T066
- (void)getLikeMsgListByUid:(NSString *)uid
                      token:(NSString *)token
                      msgId:(NSString *)msgId
                   complete:(void (^)(NSMutableArray* result))flikeList;
//4.1.10.	添加回复接口 T010
- (void)addCommentByUid:(NSString *)uid
                  token:(NSString *)token
              commentId:(NSInteger)commentId
               targetId:(NSString *)targetId
            withComment:(NSString *)comment
               complete:(void (^)(BOOL result))result;
//4.2.11.	查询粉丝信息列表接口 T023
- (void)queryFansListByUid:(NSString *)uid
                     token:(NSString *)token
                  seachUid:(NSString *)seachUid
                  pageSize:(NSString *)pageSize
                   pageNum:(NSString *)pageNum
                  complete:(void (^)(NSMutableArray* result))fansListArray;
//4.2.9.	添加关注接口 T021
- (void)addAttenByUid:(NSString *)uid
                token:(NSString *)token
         attentionUid:(NSString *)attentionUid
             complete:(void (^)(BOOL result))result;
//4.2.12.	查询关注对象信息列表接口 T024
- (void)queryAttenListByUid:(NSString *)uid
                      token:(NSString *)token
                   seachUid:(NSString *)seachUid
                   pageSize:(NSString *)pageSize
                    pageNum:(NSString *)pageNum
                   complete:(void (^)(NSMutableArray* result))concernListArray;
//4.2.10.	取消关注接口 T022
- (void)delAttenByUid:(NSString *)uid
                token:(NSString *)token
         attentionUid:(NSString *)attentionUid
             complete:(void (^)(BOOL result))result;
// 4.2.13.	查询收藏信息列表接口 T025
- (void)queryMyCollectionByUid:(NSString *)uid
                         token:(NSString *)token
                      pageSize:(NSString *)pageSize
                       pageNum:(NSString *)pageNum
                      complete:(void (^)(NSMutableArray* result))collectionListArray;
// 4.1.8.	取消收藏接口 T008
- (void)delCollectionByUid:(NSString *)uid
                     token:(NSString *)token
                      type:(NSString *)type
                  targetId:(NSString *)targetId
                  complete:(void (^)(BOOL result))result;
//4.2.7.	更新用户信息接口 T019
- (void)updateUserInfoByUid:(NSString *)uid
                      token:(NSString *)token
                   nickName:(NSString *)nickName
                    myCheck:(NSString *)myCheck
                 background:(NSString *)background
                   complete:(void (^)(BOOL result))result;
//4.4.7.	删除摄影动态接口 T036
- (void)delPhotoByUid:(NSString *)uid
                token:(NSString *)token
              photoId:(NSInteger)photoId
             complete:(void (^)(BOOL result))result;
//4.5.6.	删除视频动态接口 T042
- (void)delVideoByUid:(NSString *)uid
                token:(NSString *)token
              videoId:(NSInteger)videoId
             complete:(void (^)(BOOL result))result;

@end
